﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EzDesk.Generic;
using EzDesk.DesktopClient.ServiceLocator.ClientService;
using Microsoft.Practices.Unity;

namespace EzDesk.DesktopClient
{
    public class ManagementBase<ManagmentType> : GenericDictionary<ManagmentType> where ManagmentType : new()
    {

        private ICoreClientService _clientService;

        public ICoreClientService ClientService
        {
            get
            {
                if (_clientService == null)
                {
                    _clientService = ServiceLocator.CoreClientServiceFactory.Create();
                }
                return _clientService;
            }
            set
            {
                _clientService = value;
            }
        }
        public UserProfile CurrentUser
        {
            get
            {
                return UserManagement.Instance.LogUser;
            }
        }

        
        public DataStorage Storage { get; set; }
        public ClientDbStorage ClientDb { get; set; } 
        public ManagementBase()
        {
            this.Storage = new DataStorage();
            this.ClientDb = new ClientDbStorage();
        }

    }
}
